<?php

class Scrap extends MX_Controller
{
	function __construct()
	{
		parent::__construct();
	}

	function index()
	{
		$islogin = $this->session->userdata('is_logged_in');
		if($islogin){
			$this->load->view('includes/header');
			$data['page'] = $this->router->fetch_class();
			$this->load->view('includes/title_breadcrumbs',$data);
			$this->load->view('scrap_page');
			$this->load->view('includes/footer');
		}else{
			$this->load->view('site/front_page');
		}

	}
	
	function saveScrap(){
		$this->load->model('scrap_model');
		return $this->scrap_model->saveScrap();
	}
	
	function saveScrapTitle(){
		$this->load->model('scrap_model');
		return $this->scrap_model->saveTitle();
	}
	
	function saveUpload(){
		$this->load->model('picture_model');
		return $this->picture_model->saveUpload();
	}
	
	function getPictures(){
		$this->load->model('picture_model');
		return $this->picture_model->getPictures();
	}
	
	function getImg(){
		$this->load->model('picture_model');
		return $this->picture_model->img();
	}
	
	function getUpload(){
		$this->load->model('picture_model');
		return $this->picture_model->getUpload();
	}
}